# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-clone
pkgver=5.0.15
pkgrel=2
pkgdesc='Disk and partition backup/restore tool'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/deepin-clone"
license=('GPL3')
depends=('deepin-qt5integration' 'deepin-file-manager' 'dtkcore' 'dtkgui' 'dtkwidget' 'qt5-base'
         'gcc-libs' 'e2fsprogs' 'jfsutils' 'xfsprogs' 'partclone')
makedepends=('cmake' 'ninja' 'qt5-tools' 'deepin-gettext-tools')
groups=('deepin-extra')
source=("https://github.com/linuxdeepin/deepin-clone/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('8fe1b1c9a722af982107101a3cc28faa942081e26e2a0a9903e8a34c80e9f6f96be29d76afec57956f0b09b8cb10b3d977e35890158c47da1d817e5d3fb047f4')

prepare() {
  cd deepin-clone-$pkgver
  sed -i 's|sbin|bin|' CMakeLists.txt
}

build() {
  cd deepin-clone-$pkgver
  cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=lib .
  ninja
}

package() {
  cd deepin-clone-$pkgver
  DESTDIR="$pkgdir" ninja install
}
